/**
 * 
 */
package com.lyjilu.model.dao.impl;

import java.util.List;

import com.lyjilu.model.dao.IPopUserDao;
import com.lyjilu.model.entity.PopUser;

/**
 * @author Administrator
 * 
 */
public class PopUserDao extends BaseDao implements IPopUserDao {
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.lyjilu.model.dao.IPopUserDao#queryAll()
	 */

	@SuppressWarnings("unchecked")
	public List<PopUser> queryAll() {
		List<PopUser> list = this.getJpaTemplate().find(
				"SELECT u from PopUser u");
		return list;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.lyjilu.model.dao.IPopUserDao#login(java.lang.String)
	 */
	@Override
	public PopUser login(String username) {
		Object obj = this.findsingle(
				"SELECT u from PopUser u where u.username = ?", username);
		System.out.println(obj + "=========================="+username);
		return (obj == null) ? null : (PopUser) (obj);
	}

}
